package com.hr.mes.enums;

public enum MyExceptionEnum {

    /**
     * 异常枚举
     */
    ERROR(-1, "系统异常"),
    USER_ADD_ERROR(1, "USER_ADD_ERROR"),
    USER_DELETE_ERROR(2, "USER_DEL_ERROR"),
    USER_UPDATE_ERROR(3, "USER_UPDATE_ERROR"),
    USER_VIEW_ERROR(4, "USER_VIEW_ERROR"),

    ROLE_ADD_ERROR(11, "ROLE_ADD_ERROR"),
    ROLE_DELETE_ERROR(12, "ROLE_DELETE_ERROR"),
    ROLE_UPDATE_ERROR(13, "ROLE_UPDATE_ERROR"),
    ROLE_VIEW_ERROR(14, "ROLE_VIEW_ERROR"),

    PERMISSION_ADD_ERROR(21, "PERMISSION_ADD_ERROR"),
    PERMISSION_DELETE_ERROR(22, "PERMISSION_DELETE_ERROR"),
    PERMISSION_UPDATE_ERROR(23, "PERMISSION_UPDATE_ERROR"),
    PERMISSION_VIEW_ERROR(24, "PERMISSION_VIEW_ERROR"),

    MENU_ADD_ERROR(31, "MENU_ADD_ERROR"),
    MENU_DELETE_ERROR(32, "MENU_DEL_ERROR"),
    MENU_UPDATE_ERROR(33, "MENU_UPDATE_ERROR"),
    MENU_VIEW_ERROR(34, "MENU_VIEW_ERROR"),

    RELEASE_ADD_ERROR(41, "RELEASE_ADD_ERROR"),
    RELEASE_VIEW_ERROR(42, "RELEASE_VIEW_ERROR"),

    PROCESS_DEPLOY_ERROR(51, "部署流程模型失败"),
    PROCESS_DELETE_ERROR(52, "部署流程模型失败"),
    PROCESS_START_ERROR(53, "启动流程失败"),
    PROCESS_VIEW_ERROR(54, "查询用户的待办事项失败"),
    PROCESS_COMPLETE_ERROR(55, "完成节点任务失败"),
    PROCESS_ROLLBACK_ERROR(56, "驳回节点任务失败"),
    PROCESS_ROLLBACK_ERROR1(5601, "目标任务不存在"),
    PROCESS_ROLLBACK_ERROR2(5602, "当前任务不存在"),
    PROCESS_ROLLBACK_ERROR3(5603, "不能驳回到当前任务"),
    PROCESS_ROLLBACK_ERROR4(5604, "bpmn文件中没有目标节点的定义"),
    PROCESS_VIEW_HIS_ERROR(5605, "查询流程执行历史失败"),

    LOGIN_ERROR(61, "用户名或密码错误"),

    FIRSTITEM_ADD_ERROR(71, "FIRSTITEM_ADD_ERROR"),
    FIRSTITEM_DELETE_ERROR(72, "FIRSTITEM_DELETE_ERROR"),
    FIRSTITEM_UPDATE_ERROR(73, "FIRSTITEM_UPDATE_ERROR"),
    FIRSTITEM_VIEW_ERROR(74, "FIRSTITEM_VIEW_ERROR"),

    FORM_ADD_ERROR(81, "FORM_ADD_ERROR"),
    FORM_DELETE_ERROR(82, "FORM_DELETE_ERROR"),
    FORM_UPDATE_ERROR(83, "FORM_UPDATE_ERROR"),
    FORM_VIEW_ERROR(84, "FORM_VIEW_ERROR");

    private Integer code;

    private String msg;

    MyExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "ExceptionEnum{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                '}';
    }
}
